<?php include("../resources/views/header.php");?>
    <main class="l-main">
        <div class="l-main__inner">
            <div class="Message">
                <div class="Message__media"> <i class="Message__icon sicon-<?=$error?"danger":"check"?> u-bg-<?=$error?"danger":"success"?>"></i> </div>
                <div class="l-content">
                    <h1 class="Message__title"><?=$error?"认证失败":"认证成功"?></h1>
                    <?php if($error):?>
                    <div class="Message__content"> <?=$message?> </div>
                    <a role="button" class="btn btn--success btn--lg btn--block u-mb15" href="<?=$retry?>">重新认证</a> 
                    <?php endif?>
                    <a role="button" class="btn btn--<?=$error?"outline":"success"?> btn--lg btn--block" href="<?=$state?>" onclick="return verify()"><?=$error?"取消":"下一步"?></a> 
               </div>
            </div>
        </div>
    </main>
<?php include("../resources/views/footer.php");?>
<script type="text/javascript">
    function verify() {
        var ua = navigator.userAgent.toLowerCase();
        if (ua.match('ptime') == "ptime") {
            var payload = {
                type: 'Verify',
                content: {
                    result:1,
                    info : <?=json_encode($result)?>
                }
            };
            if (ua.match('androidweb') == "androidweb") {
                window.AndroidJsBridge.postMessage(JSON.stringify(payload));
            }else{
                window.webkit.messageHandlers.webViewApp.postMessage(payload);
            };
            return false;
        }else{
            return true;
        }
    }
</script>